Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/ibc: stateful clients #6202

Merged
merged 4 commits into from
May 12, 2020
Merged

x/ibc: stateful clients #6202

merged 4 commits into from
May 12, 2020

Conversation

fedekunze
Copy link
Collaborator

@fedekunze fedekunze commented May 12, 2020

Description

closes: #6198

cc: @colin-axner

@auto-comment
Copy link

auto-comment bot commented May 12, 2020

👋 Thanks for creating a PR!

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Thank you for your contribution to the Cosmos-SDK! 🚀

@@ -25,6 +25,7 @@ type ClientState interface {
// State verification functions

VerifyClientConsensusState(
store sdk.KVStore,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced sdk.Context with KVStore since the client won't be able to access the store thought the context unless we passed the IBC StoreKey as an argument.

This approach is more secure because we can just pass the prefix store for the specific client.

@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #6202 into master will increase coverage by 0.01%.
The diff coverage is 92.00%.

@@            Coverage Diff             @@
##           master    #6202      +/-   ##
==========================================
+ Coverage   54.83%   54.84%   +0.01%     
==========================================
  Files         444      444              
  Lines       26784    26777       -7     
==========================================
- Hits        14686    14685       -1     
+ Misses      11053    11048       -5     
+ Partials     1045     1044       -1     

Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@alessio alessio merged commit b933002 into master May 12, 2020
@alessio alessio deleted the fedekunze/6198-remove-store branch May 12, 2020 19:13
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was too slow to review, but LGTM 👍

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little late to the party, but LGTM

ctx.ChainID(),
ctx.BlockHeight(),
)
clientState = localhosttypes.NewClientState(ctx.ChainID(), ctx.BlockHeight())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks a lot cleaner 🙌 I think it'll be pretty straight forward to create interfaces funcs for clients to implement so we can remove custom client handling here (see #6064)

@@ -24,6 +26,7 @@ const (
type TendermintTestSuite struct {
suite.Suite

ctx sdk.Context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the purpose of adding this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove store from Localhost client
5 participants